package com.cq.hd.common.enums.biz;

import lombok.Getter;

/**
 * @description: 结算账户类型: 0：对公账户 1：对私法人账户 2：对私非法人账户
 * @author: mYunYu
 * @date: 2021/8/23 14:28
 * @version: v1.0
 */
public enum CardTypeEnum {

    DG(0, "对公账户"),
    DS(1, "对私法人账户"),
//    JUNGZ("02", "对私非法人账户"),
    ;

    @Getter
    private final Integer value;

    @Getter
    private final String name;

    CardTypeEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public static CardTypeEnum typeOfValue(Integer value) {
        CardTypeEnum[] values = CardTypeEnum.values();
        for (CardTypeEnum v : values) {
            if (v.value.equals(value)) {
                return v;
            }
        }
        return null;
    }

    public static CardTypeEnum typeOfName(String name) {
        CardTypeEnum[] values = CardTypeEnum.values();
        for (CardTypeEnum v : values) {
            if (v.name.equals(name)) {
                return v;
            }
        }
        return null;
    }

}
